package com.jdkutil;

import java.util.StringTokenizer;

public class StringTokenizerUtil {

    public static void main(String[] args) {
        String string = "1,23,4,5";
        StringTokenizer stringTokenizer =
                new StringTokenizer(string, ",");

        for(int i = 0; i < 10000; i++) {
            while(stringTokenizer.hasMoreTokens()) {
                stringTokenizer.nextToken();
            }
            stringTokenizer = new StringTokenizer(string, ",");
        }


        String str = "100|66,55:200|567,90:102|43,54";

        StringTokenizer strToke = new StringTokenizer(str, ":,|");// 默认不打印分隔符
// StringTokenizer strToke=new StringTokenizer(str,":,|",true);//打印分隔符
// StringTokenizer strToke=new StringTokenizer(str,":,|",false);//不打印分隔符
        while(strToke.hasMoreTokens()){
            System.out.println(strToke.nextToken());
        }
    }
}
